<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>房屋信息系统</title>
    <link rel="stylesheet" href="css/bootstrap.min.css" />
    <script src="js/bootstrap.min.js"></script>
    <script src="js/vue.js"></script>

    <link rel="stylesheet" href="css/index.css" />



    <meta charset="utf-8">

    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>


</head>

<body>
<div id="wrap">
    <nav class="navbar-default navbar-fixed-top">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.html">Shakespeare</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li><a href="search.html">我是租客</a></li>
                    <li><a href="#">我是房东</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-top navbar-right">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        聊天 <span class="caret"></span>
                    </button>
                    <dic class="dropdown-menu chat-panel">
                        <div class="btn-group" role="group" aria-label="...">
                            <button type="button" class="btn btn-default">房客李先生</button>
                            <button type="button" class="btn btn-default">房东李大爷</button>
                            <button type="button" class="btn btn-default">租客裴大哥</button>
                        </div>
                        <div class="panel panel-default chat-content">
                            <div class="panel-body chat-messages" id="chat-area">
                                <p>房客李先生：</p>
                            </div>
                        </div>
                        <input id="chat" class="form-control" type="text" placeholder="请输入聊天内容"/>
                    </dic>
                    <button class="btn1" data-toggle="modal" data-target="#login">
                        登录
                    </button>
                    <button class="btn1" data-toggle="modal" data-target="#register">
                        注册
                    </button>
                </ul>

            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
    <div class="jumbotron index-bg">
        <div class="container hover-grey">
            <h2>住 在 这 里</h2>
            <p>Shakespeare房屋信息平台旨在为房东和租客提供一个方便，快捷的信息和交易平台，租客和房东0距离。</p>
            <p>睡在山海间，住进人情里。不论你在哪个城市，Shakespeare都为您提供优质房源信息。</p>
            <p>Every people deserves a HOME.</p>
            <p><a class="btn btn-primary btn-lg" href="search.html" role="button">现在加入</a></p>
        </div>
    </div>
    <div class="container">
        <div class="input-group input-group-lg">
            <span class="input-group-addon glyphicon glyphicon-search" id="sizing-addon1">
                <a href="search.html"></a>
            </span>
            <input type="text" class="form-control"  placeholder="Adress" aria-describedby="sizing-addon1">
            <span class="input-group-btn">
            <button class="btn btn-default" type="button">Go!</button>
            </span>
        </div>
    </div>
    <div class="container-fluid" style="margin-top: 20px;">
        <div class="page-header">
            <h1>
                <small>Shakespeare's home</small>
            </h1>
        </div>
        <div class="row">
            <div class="col-xs-6 col-md-3">
                <a href="#" class="thumbnail">
                    <img src="roomdetail/house1.jpg">
                </a>
            </div>
            <div class="col-xs-6 col-md-3">
                <a href="#" class="thumbnail">
                    <img src="./img/house2.jpg">
                </a>
            </div>
            <div class="col-xs-6 col-md-3">
                <a href="#" class="thumbnail">
                    <img src="./img/house3.jpg">
                </a>
            </div>
            <div class="col-xs-6 col-md-3">
                <a href="#" class="thumbnail">
                    <img src="./img/house4.jpg">
                </a>
            </div>
        </div>
    </div>
</div>
<div class="footer">
    <div class="container" style="padding: 20px;">
        <p class="muted credit">Produced By Morroc.</p>
    </div>
</div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    用户登录
                </h4>
            </div>
            <div class="modal-body">
                <div class="main">
                    <center><div class="btn-group" data-toggle="buttons">
                        <label class="btn btn-primary1" id="op1">
                            <input type="radio" name="options"> 我是租客
                        </label>
                        <label class="btn btn-primary1" id="op2">
                            <input type="radio" name="options"> 我是房东
                        </label>
                    </div></center>
                    <br>
                    <div class="form-group">
                        <label>用户名
                            <input type="text" class="form-control"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label>密码
                            <input type="password" class="form-control"/>
                        </label>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary">
                        登录
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>

<div class="modal fade" id="register" index="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title">
                    新用户注册
                </h4>
            </div>
            <div class="modal-body">
                <div class="main">
                    <div class="center">
                        <center> <div class="btn-group" data-toggle="buttons">
                          <label class="btn btn-primary1"  id="option1">
                                <input type="radio" name="options"> 我是租客
                            </label>
                            <label class="btn btn-primary1" id="option2">
                                <input type="radio" name="options"> 我是房东
                            </label>
                        </div></center>
                    </br>
                    <div class="form-group">
                        <label>用户名
                            <input type="text" class="form-control" v-model="username"/>
                        </label>
                    </div>
                    <div class="form-group">
                        <label>密码
                            <input type="password"  class="form-control" v-model="password"/>
                        </label>
                    </div>
                        <div class="form-group">
                            <label>确认密码
                                <input type="password"  class="form-control"  placeholder=""/>
                            </label>
                        </div>
                    <div class="form-group">
                        <label>姓名
                            <input type="text" class="form-control" v-model="realName"/>
                        </label>
                    </div>

                    <div class="form-group">
                        <label>身份证号码
                            <input type="text" class="form-control" v-model="idcode"/>
                        </label>
                    </div>

                    <div class="form-con">
                        <label>手机号
                            <input type="text"   class="form-control" v-model="phone"/>
                        </label>
                    </div>
                </div>
                </div>
            <br>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary" v-on:click="register" data-dismiss="modal">
                        注册
                    </button>
                </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal -->
        </div>
    </div>

    <script>
        var op1 = document.getElementById('op1');
        var op2 = document.getElementById('op2');
        op1.onclick = function() {
            this.style.backgroundColor = '#337ab7';
            this.style.color = 'white';
            op2.style.backgroundColor = '#F8F8F8';
            op2.style.color = 'black';
        };
        op2.onclick = function() {
            this.style.backgroundColor = '#337ab7';
            this.style.color = 'white';
            op1.style.backgroundColor = '#F8F8F8';
            op1.style.color = 'black';
        };

        var option1 = document.getElementById('option1');
        var option2 = document.getElementById('option2');
        option1.onclick = function() {
            this.style.backgroundColor = '#337ab7';
            this.style.color = 'white';
            option2.style.backgroundColor = '#F8F8F8';
            option2.style.color = 'black';
        };
        option2.onclick = function() {
            this.style.backgroundColor = '#337ab7';
            this.style.color = 'white';
            option1.style.backgroundColor = '#F8F8F8';
            option1.style.color = 'black';
        }

        var register = new Vue({
            el: '#register',
            data: {
                username: '',
                password: '',
                realName: '',
                idcode: '',
                phone: '',
            },
            methods: {
                register() {
                    var that = this;
                    $.ajax({
                        url: '/user/register',
                        type: 'POST',
                        data: JSON.stringify({
                            username: that.username,
                            password: that.password,
                            realName: that.realName,
                            idcode: that.idcode,
                            phone: that.phone,
                        }),
                        dataType: 'json',
                        contentType: 'application/json',
                        success(data) {
                            alert('注册成功')
                        },
                    });
                }
            }
        })
    </script>

<script src="js/chat.js"></script>
</body>



</html>